import Vuex, {
    Store,
    StoreOptions
} from 'vuex';

import Vue from 'vue';
Vue.use(Vuex);

import createPersistedState from 'vuex-persistedstate';

import user from './modules/user';
import topics from './modules/topics';
import details from './modules/details';

const options:StoreOptions<any> = {
    modules: {
        user,
        topics,
        details
    },
    plugins: [
        createPersistedState({
            paths:[`user`],
            storage: localStorage
        })
    ]
}

export default new Store(options);

